from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver

from demo.xueqiuAppium.page.base_page import BasePage


class Profile(BasePage):
	# _driver: WebDriver
	#
	# def __init__(self, driver):
	# 	self._driver = driver

	def login(self, phone, code):
		self._driver.find_element()
		self._driver.find_elements()
		self.find(By.ID, 'tv_login_phone').click()
		self.find(By.ID, 'register_phone_number').send_keys(phone)
		self.find(By.ID, 'register_code_text').click()
		self.find(By.ID, 'register_code').send_keys(code)
		self.find(By.ID, 'button_next').click()
		msg = self.find(By.ID, 'md_buttonDefaultPositive').text
		self.find(By.ID, 'md_buttonDefaultPositive').click()
		self.find(By.ID, 'iv_action_back').click()
		return msg

